home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Browser Addons / PlanBee .exe / Disk1 / data1.cab / WebHelp / bsscdhtm.js < prev    next >
Encoding:
JavaScript  |  2001-03-30  |  70.6 KB  |  2,303 lines

  1. //////////BSSCDHTML Section 1//////////
  2. // RoboHELP« Dynamic HTML Effects Script
  3. // Copyright ⌐ 1998-2000 eHelp Corporation.  All rights reserved.
  4.  
  5. // Version=3.56
  6.  
  7. // Warning:  Do not modify this file.  It is generated by RoboHELP« and changes will be overwritten.
  8.  
  9. //{{HH_SYMBOL_SECTION
  10. var HH_ChmFilename = "";
  11. var HH_WindowName = "";
  12. var HH_GlossaryFont = "";
  13. var HH_Glossary = "";
  14. var HH_Avenue = "";
  15. var HH_ActiveX = false;
  16. //}}HH_SYMBOL_SECTION
  17.  
  18. var gbNav4 = false;
  19. var gbIE4 = false;
  20. var gbIE = false;
  21. var gbIE5 = false;
  22. var gbIE55 = false;
  23. var gAgent = navigator.userAgent.toLowerCase(); 
  24. var gbMac = (gAgent.indexOf("mac") != -1);
  25. var gbWindows = ((gAgent.indexOf("win") != -1) || (gAgent.indexOf("16bit") != -1));
  26.  
  27. var error_count = 0;
  28.  
  29. gbIE = (navigator.appName.indexOf("Microsoft") != -1);
  30. if (parseInt(navigator.appVersion) >= 4) {
  31.     gbNav4 = (navigator.appName == "Netscape");
  32.     gbIE4 = (navigator.appName.indexOf("Microsoft") != -1);
  33.  
  34.     if (gbIE4) {
  35.         if (gAgent.indexOf("msie 5.0") != -1) {
  36.             gbIE5 = true;
  37.         }
  38.         if (gAgent.indexOf("msie 5.5") != -1) { // curently IE 5.5 has some buggy stuff. we need do some remedy to our code.
  39.             gbIE55 = true;
  40.         }
  41.     }
  42. }
  43.  
  44. function HHActivateComponents()
  45. {
  46.     if (HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0])))
  47.     {
  48.         var objBody = document.all.tags("BODY")[0];
  49.         if( typeof(objBody) == "object" )
  50.         {
  51.             objBody.insertAdjacentHTML("beforeEnd", '<OBJECT ID="HHComponentActivator" CLASSID="CLSID:399CB6C4-7312-11D2-B4D9-00105A0422DF" width=0 height=0></OBJECT>');
  52.             if (HHComponentActivator.object)
  53.             {
  54.                 HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue);
  55.             }
  56.         }
  57.     }
  58. }
  59.  
  60. var gAmc = new Array();
  61. var BSSCSequenceIndex = 0;
  62.  
  63. function animationContext(el, progressAnimation, finishAnimiation, animationDuration, animationPeriod)
  64. {
  65.     this.el = el;
  66.     this.progressAnimation = progressAnimation;
  67.     this.finishAnimiation = finishAnimiation;
  68.     this.animationDuration = parseFloat(animationDuration);
  69.     this.animationPeriod = animationPeriod;
  70.     this.animationStartTime = (new Date()).getTime();
  71.     this.continueAnimation = true;
  72. }
  73.  
  74. function progressFade(ndx)
  75. {
  76.     if( typeof( gAmc[ndx].el.filters.alpha ) != "object" )
  77.         return;
  78.     
  79.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  80.     if (percent > 1.0){
  81.         percent = 1.0;
  82.         gAmc[ndx].continueAnimation = false;
  83.     }
  84.     gAmc[ndx].el.filters.alpha.opacity = gAmc[ndx].initialOpacity*(1.0-percent) +  gAmc[ndx].finalOpacity*percent;
  85.     
  86. }
  87.  
  88. function finishFade(ndx)
  89. {
  90.     if( typeof( gAmc[ndx].el.filters.alpha ) == "object" )
  91.         gAmc[ndx].el.filters.alpha.opacity = parseInt(gAmc[ndx].finalOpacity);
  92. }
  93.  
  94. function progressTranslation(ndx)
  95. {
  96.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  97.     if (percent > 1.0)    {
  98.         percent = 1.0;
  99.         gAmc[ndx].continueAnimation = false;
  100.     }
  101.     gAmc[ndx].el.style.pixelLeft = gAmc[ndx].startX*(1.0-percent) +  gAmc[ndx].finalX*percent;
  102.     gAmc[ndx].el.style.pixelTop = gAmc[ndx].startY*(1.0-percent) +  gAmc[ndx].finalY*percent;
  103. }
  104. function progressSpiral(ndx)
  105. {
  106.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  107.     if (percent > 1.0)    {
  108.         percent = 1.0;
  109.         gAmc[ndx].continueAnimation = false;
  110.     }
  111.     rf = 1.0 - percent
  112.     t = percent * 2.0*Math.PI
  113.     rx = Math.max(Math.abs(gAmc[ndx].el.initLeft), 200)
  114.     ry = Math.max(Math.abs(gAmc[ndx].el.initTop),  200)
  115.     gAmc[ndx].el.style.pixelLeft = Math.ceil(-rf*Math.cos(t)*rx)
  116.     gAmc[ndx].el.style.pixelTop  = Math.ceil(-rf*Math.sin(t)*ry)
  117.     gAmc[ndx].el.style.visibility="visible"    
  118. }
  119.  
  120. function progressElasticFromRight(ndx)
  121. {
  122.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  123.     if (percent > 1.0)    {
  124.         percent = 1.0;
  125.         gAmc[ndx].continueAnimation = false;
  126.     }
  127.     rf=Math.exp(-percent*7)
  128.     t = percent * 1.5*Math.PI
  129.     rx =Math.abs(gAmc[ndx].el.initLeft)
  130.     gAmc[ndx].el.style.pixelLeft = rf*Math.cos(t)*rx
  131.     gAmc[ndx].el.style.pixelTop = 0
  132.     gAmc[ndx].el.style.visibility="visible"    
  133. }
  134. function progressElasticFromBottom(ndx)
  135. {
  136.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  137.     if (percent > 1.0)    {
  138.         percent = 1.0;
  139.         gAmc[ndx].continueAnimation = false;
  140.     }
  141.     rf=Math.exp(-percent*7)
  142.     t = percent * 1.5*Math.PI
  143.     rx =Math.abs(gAmc[ndx].el.initTop)
  144.     gAmc[ndx].el.style.pixelLeft = 0
  145.     gAmc[ndx].el.style.pixelTop = rf*Math.cos(t)*rx
  146.     gAmc[ndx].el.style.visibility="visible"    
  147. }
  148.  
  149. function progressZoomIn(ndx)
  150. {
  151.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  152.     if (percent > 1.0)    {
  153.         percent = 1;
  154.         gAmc[ndx].continueAnimation = false;
  155.     }
  156.     for (var index=0; index<gAmc[ndx].el.all.length; index++) {
  157.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(50+50*percent) + "%"
  158.     }
  159.     gAmc[ndx].el.posLeft = 100
  160.     gAmc[ndx].el.style.visibility="visible"
  161.  
  162.     if (percent >= 1.0)    {
  163.         finishZoom(ndx);
  164.     }
  165. }
  166.  
  167. function progressZoomOut(ndx)
  168. {
  169.     percent = ((new Date()).getTime() - gAmc[ndx].animationStartTime)/gAmc[ndx].animationDuration;
  170.     if (percent > 1.0)    {
  171.         percent = 1.0;
  172.         gAmc[ndx].continueAnimation = false;
  173.     }
  174.  
  175.     for (var index=0; index<gAmc[ndx].el.all.length; index++)
  176.         gAmc[ndx].el.all[index].style.fontSize = Math.ceil(100+200*(1-percent)) + "%"
  177.     gAmc[ndx].el.posLeft = 0
  178.     gAmc[ndx].el.style.visibility="visible"
  179.  
  180.     if (percent >= 1.0)    {
  181.         finishZoom(ndx);
  182.     }
  183. }
  184. function finishTranslation(ndx)
  185. {
  186.     gAmc[ndx].el.style.pixelLeft = parseInt(gAmc[ndx].finalX);
  187.     gAmc[ndx].el.style.pixelTop = parseInt(gAmc[ndx].finalY);
  188. }
  189. function finishZoom(ndx)
  190. {
  191.     for (i=0; i<gAmc[ndx].el.all.length; i++)
  192.         gAmc[ndx].el.all[i].style.fontSize = gAmc[ndx].OldFont
  193.  
  194.  
  195. function animationPump(ndx)
  196. {
  197.     gAmc[ndx].progressAnimation(ndx);
  198.     if (gAmc[ndx].continueAnimation)
  199.         gAmc[ndx].tm = setTimeout("animationPump(" + ndx + ");", gAmc[ndx].animationPeriod);
  200. }
  201.  
  202. function clearAnimations()
  203. {
  204.     for (var index=0; index<gAmc.length; index++) {
  205.         gAmc[index].finishAnimiation(index);
  206.         clearTimeout(gAmc[index].tm);
  207.     }
  208.     gAmc = new Array();
  209. }
  210.  
  211. function startNextAnimationSet()
  212. {
  213.     clearAnimations();
  214.     bStarted = false;
  215.     bFound = false
  216.  
  217.     // Determine the next sequence number
  218.     divElements = document.all.tags("DIV");
  219.     for (var index = 0; index < divElements.length; index++) 
  220.     {
  221.         el = divElements[index];
  222.         objectOrder = el.getAttribute("BSSCObjectOrder", false);
  223.         if(null != objectOrder)
  224.         {
  225.             objectOrder = parseInt(objectOrder);
  226.             if (objectOrder > BSSCSequenceIndex && (!bFound || objectOrder < minBSSCSequenceIndexFound))
  227.             {
  228.                 minBSSCSequenceIndexFound = objectOrder;
  229.                 bFound = true;
  230.             }
  231.         }
  232.     }
  233.  
  234.     if (bFound)
  235.     {
  236.         BSSCSequenceIndex = minBSSCSequenceIndexFound;
  237.         bStarted = startAnimationSet(BSSCSequenceIndex);
  238.     }
  239. }
  240.  
  241. function getOffsetFromTopOfBrowser(el)
  242. {
  243.     if (null == el.offsetParent)
  244.         return el.offsetTop;
  245.     else
  246.         return el.offsetTop + getOffsetFromTopOfBrowser(el.offsetParent);
  247. }
  248.  
  249. function startAnimationSet(ndx)
  250. {
  251.     var m = 0;
  252.     bStarted = false;
  253.  
  254.     // Find document elements with "BSSCAnimationType" attribute
  255.     divElements = document.all.tags("DIV");
  256.     for (var index = 0; index < divElements.length; index++)
  257.     {
  258.         el = divElements[index];
  259.         
  260.         animationType = el.getAttribute("BSSCAnimationType", false);
  261.         if(null != animationType)
  262.         {
  263.             framePeriod = el.getAttribute("BSSCFramePeriod", false);
  264.             frameCount = el.getAttribute("BSSCFrameCount", false);
  265.             sequenceIndex = el.getAttribute("BSSCObjectOrder", false);
  266.  
  267.             // Stop any currently running RevealTrans filters
  268.             if ("RevealTrans" == animationType && parseInt(sequenceIndex) == ndx-1 && gbWindows)
  269.                 el.filters.RevealTrans.stop();  
  270.             // Filter on ndx
  271.             if (0 == ndx && null == sequenceIndex ||
  272.                 ndx == parseInt(sequenceIndex))
  273.             {
  274.                 if ("FlyInFromRight" == animationType)
  275.                 {
  276.                     animationDuration = el.getAttribute("BSSCDuration", false);
  277.                     if (null == animationDuration)
  278.                         animationDuration = 1000; // default to 1s
  279.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  280.                     gAmc[m].startX = document.body.clientWidth + document.body.scrollLeft;
  281.                     gAmc[m].startY = 0;
  282.                     gAmc[m].finalX = 0;
  283.                     gAmc[m].finalY = 0;
  284.                     animationPump(m++);
  285.                     bStarted = true;
  286.                 }
  287.                 if ("FlyOutToRight" == animationType)
  288.                 {
  289.                     animationDuration = el.getAttribute("BSSCDuration", false);
  290.                     if (null == animationDuration)
  291.                         animationDuration = 1000; // default to 1s
  292.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  293.                     gAmc[m].startX = 0;
  294.                     gAmc[m].startY = 0;
  295.                     gAmc[m].finalX = document.body.clientWidth + document.body.scrollWidth;
  296.                     gAmc[m].finalY = 0;
  297.                     animationPump(m++);
  298.                     bStarted = true;
  299.                 }
  300.                 if ("FlyInFromLeft" == animationType)
  301.                 {
  302.                     animationDuration = el.getAttribute("BSSCDuration", false);
  303.                     if (null == animationDuration)
  304.                         animationDuration = 1000; // default to 1s
  305.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  306.                     {
  307.                         if ("left" == el.children[childIndex].style.textAlign)
  308.                             el.children[childIndex].style.textAlign = "right";
  309.                     }
  310.                     pixelsToTranslate = document.body.clientWidth;
  311.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  312.                     gAmc[m].startX = -(document.body.clientWidth + document.body.scrollLeft);
  313.                     gAmc[m].startY = 0;
  314.                     gAmc[m].finalX = 0;
  315.                     gAmc[m].finalY = 0;
  316.                     animationPump(m++);
  317.                     bStarted = true;
  318.                 }
  319.                 if ("FlyOutToLeft" == animationType)
  320.                 {
  321.                     animationDuration = el.getAttribute("BSSCDuration", false);
  322.                     if (null == animationDuration)
  323.                         animationDuration = 1000; // default to 1s
  324.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  325.                     {
  326.                         if ("left" == el.children[childIndex].style.textAlign)
  327.                             el.children[childIndex].style.textAlign = "right";
  328.                     }
  329.                     pixelsToTranslate = document.body.clientWidth;
  330.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  331.                     gAmc[m].startX = 0;
  332.                     gAmc[m].startY = 0;
  333.                     gAmc[m].finalX = -(document.body.clientWidth + document.body.scrollWidth);
  334.                     gAmc[m].finalY = 0;
  335.                     animationPump(m++);
  336.                     bStarted = true;
  337.                 }
  338.                 if ("FlyInFromBottom" == animationType)
  339.                 {
  340.                     animationDuration = el.getAttribute("BSSCDuration", false);
  341.                     if (null == animationDuration)
  342.                         animationDuration = 1000; // default to 1s
  343.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  344.                     gAmc[m].startX = 0;
  345.                     gAmc[m].startY = document.body.clientHeight + document.body.scrollTop;
  346.                     gAmc[m].finalX = 0;
  347.                     gAmc[m].finalY = 0;
  348.                     animationPump(m++);
  349.                     bStarted = true;
  350.                 }
  351.                 if ("FlyOutToBottom" == animationType)
  352.                 {
  353.                     animationDuration = el.getAttribute("BSSCDuration", false);
  354.                     if (null == animationDuration)
  355.                         animationDuration = 1000; // default to 1s
  356.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  357.                     gAmc[m].startX = 0;
  358.                     gAmc[m].startY = 0;
  359.                     gAmc[m].finalX = 0;
  360.                     gAmc[m].finalY = document.body.clientHeight + document.body.scrollHeight;
  361.                     animationPump(m++);
  362.                     bStarted = true;
  363.                 }
  364.                 if ("FlyInFromTop" == animationType)
  365.                 {
  366.                     animationDuration = el.getAttribute("BSSCDuration", false);
  367.                     if (null == animationDuration)
  368.                         animationDuration = 1000; // default to 1s
  369.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  370.                     gAmc[m].startX = 0;
  371.                     gAmc[m].startY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  372.                     gAmc[m].finalX = 0;
  373.                     gAmc[m].finalY = 0;
  374.                     animationPump(m++);
  375.                     bStarted = true;
  376.                 }
  377.                 if ("FlyOutToTop" == animationType)
  378.                 {
  379.                     animationDuration = el.getAttribute("BSSCDuration", false);
  380.                     if (null == animationDuration)
  381.                         animationDuration = 1000; // default to 1s
  382.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  383.                     gAmc[m].startX = 0;
  384.                     gAmc[m].startY = 0;
  385.                     gAmc[m].finalX = 0;
  386.                     gAmc[m].finalY = -getOffsetFromTopOfBrowser(el) - el.offsetHeight;
  387.                     animationPump(m++);
  388.                     bStarted = true;
  389.                 }
  390.                 if ("FlyInFromBottomRight" == animationType)
  391.                 {
  392.                     animationDuration = el.getAttribute("BSSCDuration", false);
  393.                     if (null == animationDuration)
  394.                         animationDuration = 1000; // default to 1s
  395.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  396.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  397.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  398.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  399.                     gAmc[m].startX = pixelsToTranslate;
  400.                     gAmc[m].startY = pixelsToTranslate;
  401.                     gAmc[m].finalX = 0;
  402.                     gAmc[m].finalY = 0;
  403.                     animationPump(m++);
  404.                     bStarted = true;
  405.                 }
  406.                 if ("FlyOutToBottomRight" == animationType)
  407.                 {
  408.                     animationDuration = el.getAttribute("BSSCDuration", false);
  409.                     if (null == animationDuration)
  410.                         animationDuration = 1000; // default to 1s
  411.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  412.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  413.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  414.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  415.                     gAmc[m].startX = 0;
  416.                     gAmc[m].startY = 0;
  417.                     gAmc[m].finalX = pixelsToTranslate;
  418.                     gAmc[m].finalY = pixelsToTranslate;
  419.                     animationPump(m++);
  420.                     bStarted = true;
  421.                 }
  422.                 if ("FlyInFromTopRight" == animationType)
  423.                 {
  424.                     animationDuration = el.getAttribute("BSSCDuration", false);
  425.                     if (null == animationDuration)
  426.                         animationDuration = 1000; // default to 1s
  427.                     pixelsToTranslate = document.body.clientWidth;
  428.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  429.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  430.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  431.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  432.                     gAmc[m].startX = pixelsToTranslate;
  433.                     gAmc[m].startY = -pixelsToTranslate;
  434.                     gAmc[m].finalX = 0;
  435.                     gAmc[m].finalY = 0;
  436.                     animationPump(m++);
  437.                     bStarted = true;
  438.                 }
  439.                 if ("FlyOutToTopRight" == animationType)
  440.                 {
  441.                     animationDuration = el.getAttribute("BSSCDuration", false);
  442.                     if (null == animationDuration)
  443.                         animationDuration = 1000; // default to 1s
  444.                     pixelsToTranslate = document.body.clientWidth;
  445.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  446.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  447.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  448.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  449.                     gAmc[m].startX = 0;
  450.                     gAmc[m].startY = 0;
  451.                     gAmc[m].finalX = pixelsToTranslate;
  452.                     gAmc[m].finalY = -pixelsToTranslate;
  453.                     animationPump(m++);
  454.                     bStarted = true;
  455.                 }
  456.                 if ("FlyInFromTopLeft" == animationType)
  457.                 {
  458.                     animationDuration = el.getAttribute("BSSCDuration", false);
  459.                     if (null == animationDuration)
  460.                         animationDuration = 1000; // default to 1s
  461.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  462.                     {
  463.                         if ("left" == el.children[childIndex].style.textAlign)
  464.                             el.children[childIndex].style.textAlign = "right";
  465.                     }
  466.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  467.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  468.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  469.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  470.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  471.                     gAmc[m].startX = -pixelsToTranslate;
  472.                     gAmc[m].startY = -pixelsToTranslate;
  473.                     gAmc[m].finalX = 0;
  474.                     gAmc[m].finalY = 0;
  475.                     animationPump(m++);
  476.                     bStarted = true;
  477.                 }
  478.                 if ("FlyOutToTopLeft" == animationType)
  479.                 {
  480.                     animationDuration = el.getAttribute("BSSCDuration", false);
  481.                     if (null == animationDuration)
  482.                         animationDuration = 1000; // default to 1s
  483.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  484.                     {
  485.                         if ("left" == el.children[childIndex].style.textAlign)
  486.                             el.children[childIndex].style.textAlign = "right";
  487.                     }
  488.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  489.                     offsetFromTopOfBrowser = getOffsetFromTopOfBrowser(el);
  490.                     if (offsetFromTopOfBrowser + el.offsetHeight < pixelsToTranslate)
  491.                         pixelsToTranslate = offsetFromTopOfBrowser + el.offsetHeight;
  492.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  493.                     gAmc[m].startX = 0;
  494.                     gAmc[m].startY = 0;
  495.                     gAmc[m].finalX = -pixelsToTranslate;
  496.                     gAmc[m].finalY = -pixelsToTranslate;
  497.                     animationPump(m++);
  498.                     bStarted = true;
  499.                 }
  500.                 if ("FlyInFromBottomLeft" == animationType)
  501.                 {
  502.                     animationDuration = el.getAttribute("BSSCDuration", false);
  503.                     if (null == animationDuration)
  504.                         animationDuration = 1000; // default to 1s
  505.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  506.                     {
  507.                         if ("left" == el.children[childIndex].style.textAlign)
  508.                             el.children[childIndex].style.textAlign = "right";
  509.                     }
  510.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  511.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  512.                         pixelsToTranslate = document.body.clientHeight + document.body.scrollTop - el.offsetTop;
  513.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  514.                     gAmc[m].startX = -pixelsToTranslate;
  515.                     gAmc[m].startY = pixelsToTranslate;
  516.                     gAmc[m].finalX = 0;
  517.                     gAmc[m].finalY = 0;
  518.                     animationPump(m++);
  519.                     bStarted = true;
  520.                 }
  521.                 if ("FlyOutToBottomLeft" == animationType)
  522.                 {
  523.                     animationDuration = el.getAttribute("BSSCDuration", false);
  524.                     if (null == animationDuration)
  525.                         animationDuration = 1000; // default to 1s
  526.                     for (childIndex=0; childIndex<el.children.length; childIndex++)
  527.                     {
  528.                         if ("left" == el.children[childIndex].style.textAlign)
  529.                             el.children[childIndex].style.textAlign = "right";
  530.                     }
  531.                     pixelsToTranslate = document.body.clientWidth + document.body.scrollLeft;
  532.                     if (document.body.clientHeight + document.body.scrollTop - el.offsetTop < pixelsToTranslate)
  533.                         pixelsToTranslate = document.body.clientHeight +document.body.scrollTop - el.offsetTop;
  534.                     gAmc[m] = new animationContext(el, progressTranslation, finishTranslation, animationDuration, 10);
  535.                     gAmc[m].startX = 0;
  536.                     gAmc[m].startY = 0;
  537.                     gAmc[m].finalX = -pixelsToTranslate;
  538.                     gAmc[m].finalY = pixelsToTranslate;
  539.                     animationPump(m++);
  540.                     bStarted = true;
  541.                 }
  542.                 if ("FadeIn" == animationType)
  543.                 {
  544.                     if (gbWindows)
  545.                     {
  546.                         animationDuration = el.getAttribute("BSSCDuration", false);
  547.                         if (null == animationDuration)
  548.                             animationDuration = 1000; // default to 1s
  549.                         finalOpacity = el.getAttribute("BSSCFinalOpacity", false);
  550.                         if (null == finalOpacity)
  551.                             finalOpacity = 100;
  552.                         initialOpacity = el.getAttribute("BSSCInitialOpacity", false);
  553.                         if (null == initialOpacity)
  554.                             initialOpacity = 0;
  555.                         gAmc[m] = new animationContext(el, progressFade, finishFade, animationDuration, 50);
  556.                         el.filters.opacity = initialOpacity;
  557.                         gAmc[m].initialOpacity = initialOpacity;
  558.                         gAmc[m].finalOpacity = finalOpacity;
  559.                         animationPump(m++);
  560.                         bStarted = true;
  561.                     } else {
  562.                         el.style.visibility = "";
  563.                     }
  564.                 }
  565.                 if ("Spiral" == animationType)
  566.                 {
  567.                     animationDuration = el.getAttribute("BSSCDuration", false);
  568.                     if (null == animationDuration)
  569.                         animationDuration = 1000; // default to 1s
  570.  
  571.                     gAmc[m] = new animationContext(el, progressSpiral, finishTranslation, animationDuration, 10);
  572.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  573.                     gAmc[m].el.initTop = document.body.scrollTop+el.offsetTop+document.body.clientHeight;
  574.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  575.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  576.                     gAmc[m].finalX = 0;
  577.                     gAmc[m].finalY = 0;
  578.                     gAmc[m].steps = 0;
  579.                     animationPump(m++);
  580.                     bStarted = true;
  581.                 }
  582.                 if ("ElasticFromRight" == animationType)
  583.                 {
  584.                     animationDuration = el.getAttribute("BSSCDuration", false);
  585.                     if (null == animationDuration)
  586.                         animationDuration = 1000; // default to 1s
  587.                     gAmc[m] = new animationContext(el, progressElasticFromRight, finishTranslation, animationDuration, 10);
  588.                     gAmc[m].el.initLeft = el.offsetLeft+document.body.clientWidth;
  589.                     gAmc[m].el.initTop = gAmc[m].el.posTop;
  590.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  591.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  592.                     gAmc[m].finalX = 0;
  593.                     gAmc[m].finalY = 0;
  594.                     gAmc[m].steps = 0;
  595.                     animationPump(m++);
  596.                     bStarted = true;
  597.                 }
  598.                 if ("ElasticFromBottom" == animationType)
  599.                 {
  600.                     animationDuration = el.getAttribute("BSSCDuration", false);
  601.                     if (null == animationDuration)
  602.                         animationDuration = 1000; // default to 1s
  603.                     gAmc[m] = new animationContext(el, progressElasticFromBottom, finishTranslation, animationDuration, 10);
  604.                     gAmc[m].el.initLeft = gAmc[m].el.posLeft;
  605.                     gAmc[m].el.initTop = document.body.scrollTop-el.offsetTop-el.offsetHeight;
  606.                     gAmc[m].el.endLeft = gAmc[m].el.posLeft;
  607.                     gAmc[m].el.endTop  = gAmc[m].el.posTop;
  608.                     gAmc[m].finalX = 0;
  609.                     gAmc[m].finalY = 0;
  610.                     gAmc[m].steps = 0;
  611.                     animationPump(m++);
  612.                     bStarted = true;
  613.                 }
  614.                 if ("ZoomIn" == animationType)
  615.                 {
  616.                     animationDuration = el.getAttribute("BSSCDuration", false);
  617.                     if (null == animationDuration)
  618.                         animationDuration = 1000; // default to 1s
  619.                     gAmc[m] = new animationContext(el, progressZoomIn, finishZoom, animationDuration, 10);
  620.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  621.                     animationPump(m++);
  622.                     bStarted = true;
  623.                 }
  624.                 if ("ZoomOut" == animationType)
  625.                 {
  626.                     animationDuration = el.getAttribute("BSSCDuration", false);
  627.                     if (null == animationDuration)
  628.                         animationDuration = 1000; // default to 1s
  629.                     gAmc[m] = new animationContext(el, progressZoomOut, finishZoom, animationDuration, 10);
  630.                     gAmc[m].OldFont = gAmc[m].el.all[0].style.fontSize;
  631.                     animationPump(m++);
  632.                     bStarted = true;
  633.                 }
  634.                 if ("RevealTrans" == animationType)
  635.                 {
  636.                     if (gbWindows) {
  637.                         Duration = el.getAttribute("BSSCDuration", false);
  638.                         if (null == Duration)
  639.                             Duration = 1000; // default to 1s
  640.                         Transition = el.getAttribute("BSSCTransition", false);
  641.                         if (null == Transition)
  642.                             Transition = 0;
  643.                         el.style.filter = "RevealTrans();";
  644.                         el.filters.RevealTrans.Transition = Transition;
  645.                         el.filters.RevealTrans.apply();
  646.                         el.style.visibility = ""; 
  647.                         el.filters.RevealTrans.play(parseInt(Duration)/1000.0);  
  648.                         bStarted = true;
  649.                     } else {
  650.                         el.style.visibility = "";
  651.                     }
  652.                 }
  653.             }
  654.         }
  655.     }
  656.     return bStarted;
  657. }
  658.  
  659. function ApplyTextFormatting(divEl, childEl)
  660. {
  661.     childEl.setAttribute("BSSCOriginalStyle", childEl.style);
  662.  
  663.     // Text Change
  664.     hoverColor = divEl.getAttribute("BSSCHoverColor", false);
  665.     if ("Default" != divEl.getAttribute("BSSCHoverColorName"))
  666.     {
  667.         childEl.setAttribute("BSSCOriginalColor", childEl.style.color);
  668.         childEl.style.color = hoverColor;
  669.     }
  670.     hoverFontName = divEl.getAttribute("BSSCHoverFontName", false);
  671.     if (null != hoverFontName && hoverFontName != "*Default*")
  672.     {
  673.         hoverFontFamily = divEl.getAttribute("BSSCHoverFontFamily", false);
  674.         if (null != hoverFontFamily)
  675.         {
  676.             childEl.setAttribute("BSSCOriginalFontFamily", childEl.style.fontFamily);
  677.             childEl.style.fontFamily = hoverFontFamily;
  678.         }
  679.     }
  680.     hoverFontSize = divEl.getAttribute("BSSCHoverFontSize", false);
  681.     {
  682.         if (null != hoverFontSize && hoverFontSize != "*")
  683.         {
  684.             childEl.setAttribute("BSSCOriginalFontSize", childEl.style.fontSize);
  685.             childEl.style.fontSize = hoverFontSize + "pt";
  686.         }
  687.     }
  688.     hoverFontStyle = divEl.getAttribute("BSSCHoverFontStyle", false);
  689.     if (null != hoverFontStyle && "Regular" != hoverFontStyle)
  690.     {
  691.         if ("Italic" == hoverFontStyle)
  692.         {
  693.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  694.             childEl.style.fontStyle = "italic";
  695.         }
  696.         else if ("Bold" == hoverFontStyle)
  697.         {
  698.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  699.             childEl.style.fontWeight = "bold";
  700.         }
  701.         else if ("Bold Italic" == hoverFontStyle)
  702.         {
  703.             childEl.setAttribute("BSSCOriginalFontStyle", childEl.style.fontStyle);
  704.             childEl.style.fontStyle = "italic";
  705.             childEl.setAttribute("BSSCOriginalFontWeight", childEl.style.fontWeight);
  706.             childEl.style.fontWeight = "bold";
  707.         }
  708.     }
  709.     hoverUnderline = divEl.getAttribute("BSSCHoverUnderLine", false);
  710.     if (null != hoverUnderline && hoverUnderline == "TRUE")
  711.     {
  712.         childEl.setAttribute("BSSCOriginalTextDecoration", childEl.style.textDecoration);
  713.         childEl.style.textDecoration = "underline";
  714.     }
  715. }
  716.  
  717. function RemoveTextFormatting(el)
  718. {
  719.     originalColor = el.getAttribute("BSSCOriginalColor", false);
  720.     if (null != originalColor)
  721.         el.style.color = originalColor;
  722.     originalFontFamily = el.getAttribute("BSSCOriginalFontFamily", false);
  723.     if (null != originalFontFamily)
  724.         el.style.fontFamily = originalFontFamily;
  725.     originalFontSize = el.getAttribute("BSSCOriginalFontSize", false);
  726.     if (null != originalFontSize)
  727.         el.style.fontSize = originalFontSize;
  728.     originalFontStyle = el.getAttribute("BSSCOriginalFontStyle", false);
  729.     if (null != originalFontStyle)
  730.         el.style.fontStyle = originalFontStyle;
  731.     originalFontWeight = el.getAttribute("BSSCOriginalFontWeight", false);
  732.     if (null != originalFontWeight)
  733.         el.style.fontWeight = originalFontWeight;
  734.     originalTextDecoration = el.getAttribute("BSSCOriginalTextDecoration", false);
  735.     if (null != originalTextDecoration)
  736.         el.style.textDecoration = originalTextDecoration;
  737. }
  738.  
  739. function BSSCOnMouseOver(el)
  740. {
  741.     // Text Formatting
  742.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  743.     if (null != hoverColor)
  744.         for (var index=0; index<el.all.length; index++)
  745.             ApplyTextFormatting(el, el.all[index]);
  746.  
  747.     // Glow
  748.     glowColor = el.getAttribute("BSSCGlowColor", false);
  749.     if (null != glowColor)
  750.     {
  751.         glowStrength = el.getAttribute("BSSCGlowStrength", false);
  752.         if (null == glowStrength)
  753.             glowStrength = "3";
  754.         glowColorName = el.getAttribute("BSSCGlowColorName");
  755.         if ("Default" == glowColorName)
  756.             el.style.filter = "glow(Strength=" + glowStrength + ", enabled=1)";
  757.         else
  758.             el.style.filter = "glow(Color=#" + glowColor + ", Strength=" + glowStrength + ", enabled=1)";
  759.     }
  760. }
  761.  
  762. function BSSCOnMouseOut(el)
  763. {
  764.     // Text Formatting
  765.     hoverColor = el.getAttribute("BSSCHoverColor", false);
  766.     if (null != hoverColor)
  767.         for (var index=0; index<el.all.length; index++)
  768.             RemoveTextFormatting(el.all[index]);
  769.  
  770.     // Glow
  771.     glowColor = el.getAttribute("BSSCGlowColor", false);
  772.     if (null != glowColor)
  773.         el.style.filter="";
  774. }
  775.  
  776. function doStaticEffects()
  777. {
  778.     divElements = document.all.tags("DIV");
  779.     for (var index = 0; index < divElements.length; index++)
  780.     {
  781.         el = divElements[index];
  782.         
  783.         dropShadowColor = el.getAttribute("BSSCDropShadowColor");
  784.         if (null != dropShadowColor)
  785.         {
  786.             dropShadowXOffset = el.getAttribute("BSSCDropShadowXOffset");
  787.             if (null == dropShadowXOffset)
  788.                 dropShadowXOffset = 0;
  789.             dropShadowYOffset = el.getAttribute("BSSCDropShadowYOffset");
  790.             if (null == dropShadowYOffset)
  791.                 dropShadowYOffset = 0;
  792.             dropShadowColorName = el.getAttribute("BSSCDropShadowColorName");
  793.             if ("Default" == dropShadowColorName)
  794.                 el.style.filter = "DropShadow(OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  795.             else
  796.                 el.style.filter = "DropShadow(Color=" + dropShadowColor + ", OffX=" + dropShadowXOffset + ", OffY=" + dropShadowYOffset + ")";
  797.         }
  798.     }
  799. }
  800.  
  801. function drop( targetId )
  802.     target = document.all( targetId );
  803.     if (target.style.display == 'none') {
  804.        target.style.display = "" ;
  805.     } else {
  806.        target.style.display = "none";
  807.     }
  808.     event.cancelBubble = true;
  809. }
  810.  
  811. function checkParent(src,dest)
  812. {
  813.     //Search for a specific parent of the current element.
  814.     while(src !=null)
  815.     {
  816.         if(src.tagName == dest)
  817.         {
  818.             return src;
  819.         }
  820.         src = src.parentElement;
  821.     }
  822.     return null;
  823. }
  824.  
  825. //Generic Display code
  826. function outline2()
  827. {
  828.     //Expand or collapse if a list item is clicked.
  829.     var open = event.srcElement;
  830.  
  831.     //Verify that the tag which was clicked was either the 
  832.     //trigger tag or nested within a trigger tag.
  833.     var el = checkParent(open,"CITE");
  834.     if(null != el)
  835.     {    
  836.         var incr=0;
  837.         var elmPos = 0;
  838.         var parentSpan;
  839.         var fBreak
  840.  
  841.         //Get the position of the element which was clicked
  842.         elemPos = window.event.srcElement.sourceIndex;
  843.  
  844.         //Search for a SPAN tag
  845.         for (parentSpan = window.event.srcElement.parentElement; parentSpan!=null;    parentSpan = parentSpan.parentElement) 
  846.         {
  847.             //test if already at a span tag 
  848.             if (parentSpan.tagName=="SPAN") {
  849.                 incr=1;
  850.                 break;
  851.             }
  852.             
  853.             //Test if the tag clicked was in a body tag or in any of the possible kinds of lists
  854.             //we perform this test because nested lists require special handling
  855.             if (parentSpan.tagName=="BODY" || parentSpan.tagName=="UL" || parentSpan.tagName=="OL") 
  856.             {
  857.                 //Determine where the span to be expanded is.  
  858.                 for (incr=1; (elemPos+incr) < document.all.length; incr++)
  859.                 {    
  860.                     //verify we are at an expandable Div tag
  861.                     if(document.all(elemPos+incr).tagName=="SPAN" && (document.all(elemPos+incr).className=="expanded" || document.all(elemPos+incr).className=="glossexpanded" || document.all(elemPos+incr).className=="glosscollapsed" || document.all(elemPos+incr).className=="collapsed"))
  862.                     {
  863.                         fBreak=1;
  864.                         break;
  865.                     }
  866.                     else if(document.all(elemPos+incr).tagName=="LI")
  867.                     {
  868.                         //If the next tag following the list item (li) is another list item(li) return in order to prevent accidentally opening the next span in the list
  869.                         return;
  870.                     }
  871.                 }
  872.             }
  873.             //determine if we need to break out of the while loop (kind of a kludge since theres no goto in javascript)
  874.             if(fBreak==1)
  875.             {
  876.                 break;
  877.             }
  878.         }
  879.     }
  880.     else
  881.     {
  882.         return;
  883.     }
  884.  
  885.     //Now that we've identified the span, expand or collapse it
  886.     if(document.all(elemPos+incr) == null) {    
  887.         return;
  888.     } else if(document.all(elemPos+incr).className=="collapsed") {
  889.         document.all(elemPos+incr).className="expanded";
  890.     } else if(document.all(elemPos+incr).className=="expanded")  {
  891.         document.all(elemPos+incr).className="collapsed";
  892.     } else if(document.all(elemPos+incr).className=="glosscollapsed") {
  893.         document.all(elemPos+incr).className="glossexpanded";
  894.     } else if(document.all(elemPos+incr).className=="glossexpanded") {
  895.         document.all(elemPos+incr).className="glosscollapsed";
  896.     } else    {
  897.         return;
  898.     }
  899.     event.cancelBubble = true;
  900. }
  901.  
  902.  
  903. //////////BSSCDHTML Section 2//////////
  904.  
  905. function RemoveNavBar()
  906. {
  907.     // See if we are in a popup and if so remove the NavBar
  908.     if (BSSCPopup_IsPopup()) {
  909.  
  910.         if (gbIE4) {
  911.             var tempColl = document.all.tags("DIV");
  912.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  913.                 if (tempColl(iDiv).id == "NavBar") {
  914.                     tempColl(iDiv).style.visibility = gBsStyVisHide;
  915.                     if (gbIE5) {
  916.                         tempColl(iDiv).style.position = "absolute";
  917.                     }
  918.                     tempColl(iDiv).style.pixelTop = "-100px";
  919.                     break;
  920.                 }
  921.             }
  922.         } else if (gbNav4) {
  923.             for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  924.                 if (document.layers[iLayer].id == "NavBar") {
  925.                     document.layers[iLayer].visibility = gBsStyVisHide;
  926.                 }
  927.             }
  928.             if ((document.images.length > 0) && (document.images[0].src.indexOf('bsscnav1.gif') != -1)) {
  929.                 document.links[0].href = "javascript:void(null);";
  930.             }
  931.         }
  932.     }
  933.     
  934.     return;
  935. }
  936.  
  937.  
  938.  
  939. //////////////////////////////////////////////////////////////////////////////////////////////
  940. //
  941. //    Begin DHTML Popup Functions
  942. //
  943. //////////////////////////////////////////////////////////////////////////////////////////////
  944. //variables used to isolate the browser type
  945. var gBsDoc            = null;            
  946. var gBsSty            = null;
  947. var gBsHtm            = null;
  948. var gBsStyVisShow    = null;
  949. var gBsStyVisHide    = null;
  950. var gBsClientWidth    = 640;
  951. var gBsClientHeight = 480;
  952. var gBsBrowser        = null;
  953.  
  954. // here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others.
  955. var gBRateH_W        = 0.618; // 1.618 Golden cut.
  956. var gBMaxXOfParent    = 0.8; 
  957. var gBMaxYOfParent    = 0.8;
  958. var gBscrollHeight   = 16;
  959. var gBscrollWidth   =  16;
  960. var gBpermitXDelta    = 3;
  961. var gBpermitYDelta    = 3;
  962.  
  963.  
  964.  
  965. //the browser information itself
  966. function _BSPSBrowserItself()
  967. {
  968.     var agent  = navigator.userAgent.toLowerCase();
  969.     this.major = parseInt(navigator.appVersion);
  970.     this.minor = parseFloat(navigator.appVersion);
  971.     this.ns    = ((agent.indexOf('mozilla') != -1) && ((agent.indexOf('spoofer') == -1) && (agent.indexOf('compatible') == -1)));
  972.     this.ns2   = ((this.ns) && (this.major == 2));
  973.     this.ns3   = ((this.ns) && (this.major == 3));
  974.     this.ns4   = ((this.ns) && (this.major >= 4));
  975.     this.ie       = (agent.indexOf("msie") != -1);
  976.     this.ie3   = ((this.ie) && (this.major == 2));
  977.     this.ie4   = ((this.ie) && (this.major >= 4));
  978.     this.op3   = (agent.indexOf("opera") != -1);
  979.  
  980.     if (this.ns4)
  981.     {
  982.         gBsDoc        = "document";
  983.         gBsSty        = "";
  984.         gBsHtm        = ".document";
  985.         gBsStyVisShow    = "show";
  986.         gBsStyVisHide    = "hide";
  987.  
  988.     }
  989.     else if (this.ie4)
  990.     {
  991.         gBsDoc         = "document.all";
  992.         gBsSty         = ".style";
  993.         gBsHtm         = "";
  994.         gBsStyVisShow    = "visible";
  995.         gBsStyVisHide    = "hidden";
  996.     }
  997. }
  998.  
  999. //Here is the browser type 
  1000. function _BSPSGetBrowserInfo()
  1001. {
  1002.     gBsBrowser    = new _BSPSBrowserItself();
  1003. }
  1004.  
  1005. //Get client size info
  1006. function _BSPSGetClientSize()
  1007. {
  1008.     if (gBsBrowser.ns4)
  1009.     {
  1010.         gBsClientWidth    = innerWidth;
  1011.         gBsClientHeight = innerHeight;
  1012.  
  1013.     }
  1014.     else if (gBsBrowser.ie4)
  1015.     {
  1016.         gBsClientWidth    = document.body.clientWidth;
  1017.         gBsClientHeight = document.body.clientHeight;
  1018.     }
  1019. }
  1020.  
  1021.  
  1022. var gstrPopupID = 'BSSCPopup';
  1023. var gstrPopupShadowID = 'BSSCPopupShadow';
  1024. var gstrPopupTopicID = 'BSSCPopupTopic';
  1025. var gstrPopupIFrameID = 'BSSCPopupIFrame';
  1026. var gstrPopupIFrameName = 'BSSCPopupIFrameName';
  1027.  
  1028. var gstrPopupSecondWindowName = 'BSSCPopup';
  1029.  
  1030. var    gPopupDiv = null;
  1031. var gPopupDivStyle = null;
  1032. var    gPopupShadow = null;
  1033. var    gPopupTopic = null;
  1034. var gPopupIFrame = null;
  1035. var gPopupIFrameStyle = null;
  1036. var gPopupWindow = null;
  1037. var gnPopupClickX = 0;
  1038. var gnPopupClickY = 0;
  1039.  
  1040. var gnPopupScreenClickX = 0;
  1041. var gnPopupScreenClickY = 0;
  1042.  
  1043. var gbPopupTimeoutExpired = false;
  1044.  
  1045. var gbScriptName = "EHELP_DHTM";
  1046. var gbPathofJS = "";
  1047.  
  1048.  
  1049. if (gbIE4) {
  1050.     var aScripts = document.scripts;
  1051.     var aScript = null;
  1052.     var i = 0;
  1053.     for (i = 0; i < aScripts.length ; i ++ )
  1054.     {
  1055.         if (aScripts[i].name == gbScriptName) {
  1056.             aScript = aScripts[i];
  1057.             break;
  1058.         }
  1059.         
  1060.     }
  1061.  
  1062.     if (aScript != null) {
  1063.         var nPathPos = 0;
  1064.         var strCurrentSrc = "";
  1065.         strCurrentSrc = aScript.src;
  1066.         var nPathPos1 = strCurrentSrc.lastIndexOf("\\");
  1067.         var nPathPos2 = strCurrentSrc.lastIndexOf("/");
  1068.         if (nPathPos1 > nPathPos2)
  1069.             nPathPos = nPathPos1 + 1;
  1070.         else
  1071.             nPathPos = nPathPos2 + 1;
  1072.  
  1073.         gbPathofJS = strCurrentSrc.substring(0, nPathPos);
  1074.     }
  1075. }
  1076.  
  1077. // Replace point - Used by SingleSource 
  1078. // var gbBlankPageForIFrame = gbPathofJS + "_blank.htm";
  1079. var gbBlankPageForIFrame = "about:blank";
  1080.  
  1081. if (BSSCPopup_IsPopup()) {
  1082.     document.write("<base target=\"_parent\">");
  1083. }
  1084.  
  1085. function DHTMLPopupSupport()
  1086. {
  1087.     if ((gbIE4) && (!gbMac)) {
  1088.         return true;
  1089.     }
  1090.     return false;
  1091. }
  1092.  
  1093.  
  1094.  
  1095. function BSSCPopup_IsPopup()
  1096. {
  1097.     if (DHTMLPopupSupport() && (this.name == gstrPopupIFrameName)) {
  1098.         return true;
  1099.     } else if ((gbNav4 || gbIE4) && (this.name == gstrPopupID)) {
  1100.         return true;
  1101.     } else {
  1102.         return false;
  1103.     }
  1104. }
  1105.  
  1106. var gbBsPopupDivInit = false;
  1107. function _BSSCCreatePopupDiv()
  1108. {
  1109.     if (!gbBsPopupDivInit) {
  1110.         if (DHTMLPopupSupport()) {
  1111.             document.write("<DIV ID='" + gstrPopupID + "' STYLE='position:absolute; width:0; height:0; top:-100; left:0; z-index:600; visibility:hidden;'>");
  1112.             document.write("<DIV ID='" + gstrPopupShadowID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#C0C0C0;\"></DIV>");
  1113.             document.write("<DIV ID='" + gstrPopupTopicID + "' STYLE=\"position:absolute;top:0; left:0;  width:0; height:0; background-color:#FFFFFF;border:1px #000000 outset;\">");
  1114.             document.write("<IFRAME ID='" + gstrPopupIFrameID + "' name='" + gstrPopupIFrameName + "' src = '" + gbBlankPageForIFrame + "' frameborder=0 scrolling=auto></IFRAME>");
  1115.             document.write("</DIV></DIV>");
  1116.         }
  1117.     }
  1118.     gbBsPopupDivInit = true;
  1119. }
  1120.  
  1121. function BSSCPopup_Timeout()
  1122. {
  1123.     if ((gPopupIFrame.document.readyState == "complete") &&
  1124.         (gPopupIFrame.document.body != null) && 
  1125.         (gPopupIFrame.location.href.indexOf(gbBlankPageForIFrame) == -1)) {
  1126.         window.gPopupDivStyle.visibility = gBsStyVisShow;
  1127.         BSSCPopup_TimeoutReal();
  1128.     } else {
  1129.         setTimeout("BSSCPopup_Timeout()", 100);
  1130.     }
  1131. }
  1132.  
  1133. function BSSCPopup_TimeoutReal()
  1134. {
  1135.     window.gbPopupTimeoutExpired = true;
  1136.  
  1137.     if (gPopupIFrame.document) {
  1138.         BSSCPopup_ChangeTargettoParent(gPopupIFrame.document);
  1139.         gPopupIFrame.document.body.onclick = BSSCPopupClicked;
  1140.     }
  1141.     document.onmousedown = BSSCPopupParentClicked;
  1142. }
  1143.  
  1144. function BSSCPopup_ChangeTargettoParent(tagsObject)
  1145. {
  1146.     var collA = tagsObject.all.tags("A");
  1147.     var j = 0;
  1148.     if (collA != null) {
  1149.         for (j = 0; j < collA.length; j ++ )
  1150.         {
  1151.             collA[j].target = "_parent";
  1152.         }
  1153.  
  1154.     }
  1155. }
  1156.  
  1157. function BSPSPopupTopicWinHelp(strURL)
  1158. {
  1159.     _BSSCPopup(strURL);
  1160.     return;
  1161. }
  1162.  
  1163. function _BSSCPopup(strURL)
  1164. {
  1165.     if (DHTMLPopupSupport()) {
  1166.  
  1167.         // If we are already in a popup, replace the contents
  1168.         if (BSSCPopup_IsPopup()) {
  1169.  
  1170.             location.href = strURL;
  1171.             parent.window.gbPopupTimeoutExpired = false;
  1172.             if (gbMac) {
  1173.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 400);
  1174.             } else {
  1175.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 100);
  1176.             }
  1177.             
  1178.         } else {
  1179.             var tempColl = document.all.tags("DIV");
  1180.             for (var iDiv = 0; iDiv < tempColl.length; iDiv++) {
  1181.                 if (tempColl(iDiv).id == gstrPopupID) {
  1182.                     gPopupDiv = tempColl(iDiv);
  1183.                 }
  1184.                 if (tempColl(iDiv).id == gstrPopupShadowID) {
  1185.                     gPopupShadow = tempColl(iDiv);
  1186.                 }
  1187.                 if (tempColl(iDiv).id == gstrPopupTopicID) {
  1188.                     gPopupTopic = tempColl(iDiv);
  1189.                 }
  1190.             }
  1191.             
  1192.             gPopupIFrame = eval("gPopupDiv.document.frames['" + gstrPopupIFrameName + "']");
  1193.             gPopupDivStyle = eval("gPopupDiv" + gBsSty);
  1194.             gPopupIFrameStyle = eval(gBsDoc + "['" + gstrPopupIFrameName + "']" + gBsSty);
  1195.  
  1196.  
  1197.             // Load the requested URL into the IFRAME
  1198.             gPopupIFrame.location.href = strURL;
  1199.             window.gbPopupTimeoutExpired = false;
  1200.             if (gbMac) {
  1201.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 400);
  1202.             } else {
  1203.                 setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 100);
  1204.             }
  1205.         }
  1206.  
  1207.     } else {
  1208.         _BSSCPopup2(strURL);
  1209.     }
  1210.     return;
  1211. }
  1212.  
  1213.  
  1214. function _BSSCPopup2(strURL)
  1215. {
  1216.     if (window.name == gstrPopupSecondWindowName) {
  1217.         window.location = strURL;
  1218.     } else {
  1219.  
  1220.         BSSCHidePopupWindow();
  1221.         var nX = 0;
  1222.         var nY = 0;
  1223.         var nHeight = 300;
  1224.         var nWidth = 400;
  1225.         _BSPSGetClientSize();
  1226.         if (gBsBrowser.ns4) {
  1227.             nX = window.screenX + (window.outerWidth - window.innerWidth) + window.gnPopupClickX;
  1228.             nY = window.screenY + (window.outerHeight - window.innerHeight) + window.gnPopupClickY;
  1229.         } else {
  1230.             nX = window.gnPopupScreenClickX;
  1231.             nY = window.gnPopupScreenClickY;
  1232.         }
  1233.         if (nY + nHeight + 40 > screen.availHeight) {
  1234.             nY = screen.availHeight - nHeight - 40;
  1235.         }
  1236.         if (nX + nWidth + 40 > screen.availWidth) {
  1237.             nX = screen.availWidth - nWidth - 40;
  1238.         }
  1239.         // Launch a separate window
  1240.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes";
  1241.         if (gBsBrowser.ns) {
  1242.             strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth;
  1243.             strParam += ",screenX=" + nX + ",screenY=" + nY;
  1244.             strParam += ",dependent=yes";
  1245.         }
  1246.         else {
  1247.             strParam += ",height=" + nHeight + ",width=" + nWidth;
  1248.             strParam += ",left=" + nX + ",top=" + nY;
  1249.         }
  1250.         window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam);
  1251.         if (gBsBrowser.ns4) {
  1252.             window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUE);
  1253.             window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1254.             window.gPopupWindow.onblur = NonIEPopup_HandleBlur;
  1255.         }
  1256.         else if (gBsBrowser.ie4)
  1257.         {
  1258.             window.gPopupWindow.focus();
  1259.         }
  1260.     }
  1261.     return;
  1262. }
  1263.  
  1264. function NonIEPopup_HandleBlur(e)
  1265. {
  1266.     window.gPopupWindow.focus();
  1267. }
  1268.  
  1269. function NonIEPopup_HandleClick(e)
  1270. {
  1271.     // Because navigator will give the event to the handler before the hyperlink, let's
  1272.     // first route the event to see if we are clicking on a Popup menu in a popup.
  1273.     document.routeEvent(e);
  1274.  
  1275.     // If a popup menu is active then don't do anything with the click
  1276.     if (window.gPopupWindow.gbInPopupMenu) {
  1277.         window.gPopupWindow.captureEvents(Event.CLICK);
  1278.         window.gPopupWindow.onclick = NonIEPopup_HandleClick;
  1279.         return false;
  1280.     }
  1281.  
  1282.     // Close the popup window
  1283.     if (e.target.href != null) {
  1284.         window.location.href = e.target.href;
  1285.         if (e.target.href.indexOf("BSSCPopup") == -1) {
  1286.             this.close();
  1287.         }
  1288.     } else {
  1289.         this.close();
  1290.     }
  1291.     return false;
  1292. }
  1293.  
  1294. function BSSCPopup_AfterLoad(strURL)
  1295. {    
  1296.     if (typeof(window.gPopupIFrame.document) == "unknown") {
  1297.         _BSSCPopup2(strURL);
  1298.         return;
  1299.     }
  1300.     if ((window.gPopupIFrame.document.readyState == "complete") &&
  1301.         (window.gPopupIFrame.document.body != null) && 
  1302.         (window.gPopupIFrame.location.href.indexOf(gbBlankPageForIFrame) == -1)) {
  1303.         BSSCPopup_ResizeAfterLoad(strURL);
  1304.     }  else {
  1305.         setTimeout("BSSCPopup_AfterLoad('" + strURL + "')", 200);
  1306.     }
  1307. }
  1308.  
  1309.  
  1310. function BSSCPopup_ResizeAfterLoad(strURL)
  1311. {
  1312.     window.gPopupDivStyle.visibility = gBsStyVisHide;
  1313.  
  1314.     // Determine the width and height for the window
  1315.     //var size = new BSSCSize(0, 0);
  1316.     //BSSCGetContentSize(window.gPopupIFrame, size);
  1317.     //var nWidth = size.x;
  1318.     //var nHeight = size.y;
  1319.  
  1320.  
  1321.     _BSPSGetClientSize();
  1322.  
  1323.     var size = new BSSCSize(0, 0);
  1324.  
  1325.     BSSCGetContentSize(window.gPopupIFrame, size);
  1326.  
  1327.     // Determine the width and height for the window
  1328.     var nWidth = size.x;
  1329.     var nHeight = size.y;
  1330.         
  1331.     window.gPopupDivStyle.width = nWidth;
  1332.     window.gPopupDivStyle.height = nHeight;
  1333.  
  1334.     // Determine the position of the window
  1335.     var nClickX = window.gnPopupClickX;
  1336.     var nClickY = window.gnPopupClickY;
  1337.     var nTop = 0;
  1338.     var nLeft = 0;
  1339.  
  1340.     if (nClickY + nHeight + 20 < gBsClientHeight + document.body.scrollTop) {
  1341.         nTop = nClickY + 10;
  1342.     } else {
  1343.         nTop = (document.body.scrollTop + gBsClientHeight) - nHeight - 20;
  1344.     }
  1345.     if (nClickX + nWidth < gBsClientWidth + document.body.scrollLeft) {
  1346.         nLeft = nClickX;
  1347.     } else {
  1348.         nLeft = (document.body.scrollLeft + gBsClientWidth) - nWidth - 8;
  1349.     }
  1350.     
  1351.     if (nTop < document.body.scrollTop ) nTop  = document.body.scrollTop + 1;
  1352.     if (nLeft< document.body.scrollLeft) nLeft = document.body.scrollLeft + 1;
  1353.  
  1354.  
  1355.     window.gPopupDivStyle.left = nLeft;
  1356.     window.gPopupDivStyle.top = nTop;
  1357.  
  1358.     // Set the location of the background blocks
  1359.     window.gPopupShadow.style.left = 6;
  1360.     window.gPopupShadow.style.top = 6;
  1361.     if (gbIE55)
  1362.     {
  1363.         window.gPopupShadow.style.left = 4;
  1364.         window.gPopupShadow.style.top = 4;
  1365.     }
  1366.     window.gPopupShadow.style.width = nWidth;
  1367.     window.gPopupShadow.style.height = nHeight;
  1368.     window.gPopupTopic.style.width = nWidth;
  1369.     window.gPopupTopic.style.height = nHeight;
  1370.     if (gbIE55)
  1371.     {
  1372.         window.gPopupShadow.style.width = nWidth + 2;
  1373.         window.gPopupShadow.style.height = nHeight + 2;
  1374.         window.gPopupTopic.style.width = nWidth + 2;
  1375.         window.gPopupTopic.style.height = nHeight + 2;
  1376.     }
  1377.  
  1378.  
  1379.     if (gbMac) {
  1380.         // Total hack on the iMac to get the IFrame to position properly
  1381.         window.gPopupIFrameStyle.pixelLeft = 100;
  1382.         window.gPopupIFrameStyle.pixelLeft = 0;
  1383.         // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it
  1384.         window.gPopupIFrame.window.BSSCOnLoad();
  1385.     }
  1386.     //var nOriWidth = window.gPopupIFrameStyle.width
  1387.  
  1388.     window.gPopupIFrameStyle.width = nWidth;
  1389.     window.gPopupIFrameStyle.height = nHeight;
  1390.     if (gbIE55)
  1391.     {
  1392.         window.gPopupIFrameStyle.top = 0;
  1393.         window.gPopupIFrameStyle.left = 0;
  1394.     }
  1395.  
  1396.     gPopupIFrame.location.href = strURL;  // reload again, this will fix the bookmark misunderstand in IE5.
  1397.  
  1398.     if (gbIE55)
  1399.     {
  1400.         window.gPopupDivStyle.visibility = gBsStyVisShow;
  1401.     }
  1402.  
  1403.     setTimeout("BSSCPopup_Timeout();", 100);
  1404.     
  1405.     return false;
  1406. }
  1407.  
  1408.  
  1409. function    BSSCSize(x, y)
  1410. {
  1411.     this.x = x;
  1412.     this.y = y;
  1413. }
  1414.  
  1415. function BSSCGetContentSize(thisWindow, size)
  1416. {
  1417.     if (!((gBsBrowser.ie4) || (gBsBrowser.ns4)))
  1418.         return;
  1419.  
  1420.     if (gbMac) {
  1421.         size.x = 300;
  1422.         size.y = 300;
  1423.         return;
  1424.     }
  1425.  
  1426.     // Resize the width until it is wide enough to handle the content
  1427.     // The trick is to start wide and determine when the scrollHeight changes
  1428.     // because then we know a scrollbar is necessary. We can then go back
  1429.     // to the next widest size (for no scrollbar)
  1430.  
  1431.     var ClientRate = gBsClientHeight / gBsClientWidth;
  1432.  
  1433.     var GoldenSize = new BSSCSize(0,0);
  1434.     GoldenSize.x = gBsClientWidth * gBMaxXOfParent;
  1435.     GoldenSize.y = gBsClientHeight *gBMaxYOfParent ;
  1436.  
  1437.     if (ClientRate > gBRateH_W) {
  1438.         GoldenSize.y = GoldenSize.x * gBRateH_W;
  1439.     }
  1440.     else {
  1441.         GoldenSize.x = GoldenSize.y / gBRateH_W;
  1442.     }
  1443.  
  1444.     // Try to using parent specified max x.
  1445.     var x = 0;
  1446.     var maxgoldx = GoldenSize.x;
  1447.     var maxx = gBsClientWidth * gBMaxXOfParent;
  1448.     
  1449.     // This double resize causes the document to re-render (and we need it to)
  1450.     thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4.
  1451.     thisWindow.resizeTo(1, 1);
  1452.     thisWindow.resizeTo(1, 1);
  1453.     thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
  1454.     thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight);
  1455.         
  1456.     var miny = thisWindow.document.body.scrollHeight + gBscrollHeight;
  1457.     
  1458.     if (miny > GoldenSize.y) // the popup does not fix in the parent wanted golden area. so try to expand itself as large as it can
  1459.     {
  1460.         thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
  1461.         thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight);
  1462.         
  1463.         miny =     thisWindow.document.body.scrollHeight + gBscrollHeight;
  1464.         maxy = gBsClientHeight * gBMaxYOfParent;
  1465.         
  1466.         if (miny > maxy) { // the popup must have a scroll, OK let it be.
  1467.             miny = maxy;
  1468.             size.x = maxx;
  1469.             size.y = maxy;
  1470.         }
  1471.         else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent.
  1472.             size.y = miny;
  1473.             
  1474.             //  downsize from maxx , now I try to using binary divide.
  1475.             x = maxx;
  1476.             deltax = -maxx/2;
  1477.             //j = 0;
  1478.             while (true) {
  1479.                 x = x + deltax;
  1480.                 thisWindow.resizeTo(x, miny);
  1481.                 thisWindow.resizeTo(x, miny);
  1482.                 diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate;
  1483.                 if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  1484.                     deltax = Math.abs(deltax) /2;
  1485.                 else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  1486.                     deltax = -Math.abs(deltax) /2;
  1487.                 else 
  1488.                     // the y is close enough to wanted.
  1489.                     break;
  1490.                 if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  1491.                     break;
  1492.                 //j ++;
  1493.                 
  1494.             }
  1495.             size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
  1496.             size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;    
  1497.             thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  1498.             
  1499.         // Handle absurd cases just in case IE flakes
  1500.     //        if (size.y < 100) {
  1501.     //            size.y = 100;
  1502.     //        }
  1503.         }
  1504.     }
  1505.     else {
  1506.         //  downsize from maxgoldx , now I try to using binary divide.
  1507.         x = maxgoldx;
  1508.         deltax = -maxgoldx/2;
  1509.         //i = 0;
  1510.         while (true) {
  1511.             x = x + deltax;
  1512.             thisWindow.resizeTo(x, miny);
  1513.             thisWindow.resizeTo(x, miny);
  1514.             diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W;
  1515.             if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  1516.                 deltax = Math.abs(deltax) /2;
  1517.             else if (diffy <  -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  1518.                 deltax = -Math.abs(deltax) /2;
  1519.             else 
  1520.                 // the y is close enough to wanted.
  1521.                 break;
  1522.             if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  1523.                 break;
  1524.             //i ++;
  1525.                 
  1526.         }
  1527.         size.x = thisWindow.document.body.scrollWidth ;//+ gBscrollWidth;
  1528.         size.y = thisWindow.document.body.scrollHeight ;//+ gBscrollHeight;    
  1529.         thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  1530.     }
  1531.  
  1532.     if ((gbIE4) && (!gbIE5))
  1533.     {
  1534.         size.x = size.x + 16;    //reserve a width for scrollbar (IE 4.0 only)
  1535.     }
  1536.  
  1537.     thisWindow.resizeTo(size.x, size.y);
  1538.     thisWindow.resizeTo(size.x, size.y);
  1539.  
  1540.     return;
  1541. }
  1542.  
  1543.  
  1544.  
  1545. function BSSCPopupParentClicked()
  1546. {
  1547.     BSSCPopupClicked();
  1548.     return;
  1549. }
  1550.  
  1551.  
  1552. function BSSCPopupClicked()
  1553. {
  1554.     if (!window.gbPopupTimeoutExpired) {
  1555.         return false;
  1556.     }
  1557.  
  1558.     if (gPopupIFrame.window.gbInPopupMenu) {
  1559.         return false;
  1560.     }
  1561.  
  1562.     // Give the user a message about javascript calls through objects.
  1563.     if ((gPopupIFrame.window.event != null) &&
  1564.         (gPopupIFrame.window.event.srcElement != null) &&
  1565.         (gPopupIFrame.window.event.srcElement.tagName == "A") &&
  1566.         (gPopupIFrame.window.event.srcElement.href.indexOf("javascript:") == 0) &&
  1567.         (gPopupIFrame.window.event.srcElement.href.indexOf(".") != -1)) {
  1568.         gPopupIFrame.window.event.cancelBubble = true;
  1569.         alert('Hyperlinks to objects do not work in popups.');
  1570.         return false;
  1571.     }
  1572.  
  1573.     document.onclick = null;
  1574.     document.onmousedown = null;
  1575.  
  1576.     // Simply hide the popup
  1577.     gPopupDivStyle.visibility = gBsStyVisHide;
  1578.     gPopupIFrame.location.href = gbBlankPageForIFrame;
  1579.  
  1580.     window.gbPopupTimeoutExpired = false;
  1581.  
  1582.  
  1583.     return true;
  1584. }
  1585.  
  1586.  
  1587. //trace the mouse over's position for hotspot
  1588. function  BSPSPopupOnMouseOver(event)
  1589. {
  1590.     if (gBsBrowser.ie4) {
  1591.         window.gnPopupClickX = event.clientX + document.body.scrollLeft;
  1592.         window.gnPopupClickY = event.clientY + document.body.scrollTop;
  1593.         window.gnPopupScreenClickX = event.screenX;
  1594.         window.gnPopupScreenClickY = event.screenY;
  1595.     } else if (gBsBrowser.ns4) {
  1596.         window.gnPopupClickX = event.pageX;
  1597.         window.gnPopupClickY = event.pageY;
  1598.     }
  1599. }
  1600.  
  1601. function BSSCHidePopupWindow()
  1602. {
  1603.     if (window.gPopupWindow != null) {
  1604.         if (gBsBrowser.ns4) {
  1605.             if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) {
  1606.                 window.gPopupWindow.close();
  1607.                 window.gPopupWindow = null;
  1608.             }
  1609.         }
  1610.     }
  1611.  
  1612.     return;
  1613. }
  1614.  
  1615. var gbPopupMenuTimeoutExpired = false;
  1616. var gbInPopupMenu = false;
  1617. var gbPopupMenuTopicList = null;
  1618.  
  1619. //////////////////////////////////////////////////////////////////////////////////////////
  1620. //
  1621. // Popup Menu code
  1622. //
  1623. //////////////////////////////////////////////////////////////////////////////////////////
  1624.  
  1625.  
  1626. function _WritePopupMenuLayer()
  1627. {
  1628.     if (gbNav4) {
  1629. //Do not try to write ininle styles for NS!  NS can not handle it and will not stop downloading the html page...
  1630.        var strStyle = "";
  1631.        strStyle += "<style>";
  1632.        strStyle += "<!--"
  1633.        strStyle += "div.WebHelpPopupMenu {position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;}";
  1634.        strStyle += "-->";
  1635.        strStyle += "</style>";
  1636.        document.write(strStyle);
  1637.        document.write("<DIV CLASS='WebHelpPopupMenu' ID='PopupMenu'></DIV>");
  1638.     } else {         document.write("<DIV ID='PopupMenu' STYLE='position:absolute; left:0px; top:0px; z-index:4; visibility:hidden;'></DIV>");
  1639.            if (gbIE4) {
  1640.         document.write("<STYLE TYPE='text/css'>");
  1641.         if (gbMac) {
  1642.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:10pt; text-decoration:none;}");
  1643.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:10pt; text-decoration:none;}");
  1644.         } else {
  1645.             document.write(".PopupOver {font-family:'Arial'; color:white; background:navy; font-size:8pt; text-decoration:none;}");
  1646.             document.write(".PopupNotOver {font-family:'Arial'; color:black; background:#c0c0c0; font-size:8pt; text-decoration:none;}");
  1647.         }
  1648.         document.write("</STYLE>");
  1649.            }
  1650.     }
  1651. }
  1652.  
  1653. //Define variable arguments as: strTitle, strUrl
  1654. function PopupMenuTopicEntry() 
  1655. {
  1656.     this.strTitle = PopupMenuTopicEntry.arguments[0];
  1657.     this.strURL = PopupMenuTopicEntry.arguments[1];
  1658. }
  1659.  
  1660. // If the topic list is set, it is an array of TopicEntry objects (defined in WebHelp3.js)
  1661. function PopupMenu_SetTopicList(aPopupTopicArray)
  1662. {
  1663.     gbPopupMenuTopicList = aPopupTopicArray;
  1664. }
  1665.  
  1666. //Seek for the bsscright frame 
  1667. function _SeekFrameByName( cRoot, strName )
  1668. {
  1669.     if( cRoot == null )    return null;
  1670.     if( cRoot.frames == null )    return null;
  1671.     if( cRoot.frames[strName] != null )    return cRoot.frames[strName];
  1672.     for (var i=0; i<cRoot.frames.length; i++)
  1673.     {
  1674.         var cObj = _SeekFrameByName( cRoot.frames(i).document, strName );
  1675.         if( cObj != null )        return cObj;
  1676.     };
  1677.     return null;
  1678. }
  1679. function _GetFrameByName( cRoot, strName )
  1680. {
  1681.     if( cRoot == null )    return null;
  1682.     var cRet = _SeekFrameByName(cRoot, strName);
  1683.     if( cRet != null )    return cRet;
  1684.     return _GetFrameByName( cRoot.parent, strName );
  1685. }
  1686.  
  1687. function _PopupMenu_Invoke(fn_arguments)
  1688. {
  1689.     if ((!gbIE4 && !gbNav4) || ((gbMac) && (gbIE4) && (window.event.srcElement.tagName == "AREA"))) {
  1690.     
  1691.         var argLen     = fn_arguments.length;
  1692.  
  1693.         // Create the window that the hyperlinks will go into
  1694.         var nHeight = argLen * 15;
  1695.         var nWidth = 400;
  1696.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  1697.         strParam += ",height=" + nHeight + ",width=200";
  1698.         strParam += ",resizable";
  1699.  
  1700.         // Create a temporary window first to ensure the real popup comes up on top
  1701.         var wndTemp = window.open("", "temp", strParam);
  1702.  
  1703.         // Create the real popup window
  1704.         var wndPopupLinks = window.open("", "popuplinks", strParam);
  1705.  
  1706.         // Close the temporary
  1707.         wndTemp.close();
  1708.  
  1709.         wndPopupLinks.document.open("text/html");
  1710.         wndPopupLinks.document.write("<html><head></head>");
  1711.         wndPopupLinks.document.write("<body onBlur=\'self.focus();\'>");
  1712.         var strParaLine = "";
  1713.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  1714.             strParaLine = "";
  1715.             strParaLine += "<a href=\"javascript:";
  1716.             if (gbIE) {
  1717.                 strParaLine += "onBlur=null; ";
  1718.             }
  1719.             strParaLine += "opener.location=\'";
  1720.             strParaLine += fn_arguments[2 * i + 3];
  1721.             strParaLine += "\';close();\"";
  1722.             if (fn_arguments[1] != '') {
  1723.                 strParaLine += " TARGET='" + fn_arguments[1] + "'";
  1724.             }
  1725.             strParaLine += ">";
  1726.             strParaLine += fn_arguments[2 * i + 2];
  1727.             strParaLine += "</a>";
  1728.             strParaLine += "<br>";
  1729.             wndPopupLinks.document.write(strParaLine);
  1730.         }
  1731.         wndPopupLinks.document.write("</body></html>");
  1732.         wndPopupLinks.document.close();
  1733.         window.gbInPopupMenu = true;
  1734.         if (!gbIE) {
  1735.             wndPopupLinks.focus();
  1736.         }
  1737.  
  1738.         return false;
  1739.     }
  1740.  
  1741.     // Make sure we have reasonable arguments
  1742.     var argLen = fn_arguments.length;
  1743.     if (argLen < 3) {
  1744.         return false;
  1745.     }
  1746.  
  1747.     // Check to see if we only have one target
  1748.     var strTarget = "";
  1749.     if (((argLen < 5) && ((isNaN(fn_arguments[2])) || (gbPopupMenuTopicList == null))) ||
  1750.         ((argLen < 4) && ((!isNaN(fn_arguments[2])) && (gbPopupMenuTopicList != null)))) {
  1751.  
  1752.         // Get the place that we will be putting the topic into
  1753.         var targetDoc = null;
  1754.         if (fn_arguments[1] == '') {
  1755.             targetDoc = window.document;
  1756.         } else {
  1757.             targetDoc = _GetFrameByName( parent, fn_arguments[1] );
  1758.             if (targetDoc == null) {
  1759.                 targetDoc  = window.document;
  1760.             }
  1761.             //if (gbIE4) {
  1762.             //        targetDoc = eval("top.document.frames['" + fn_arguments[1] + "']");
  1763.             //    } else if (gbNav4) {
  1764.             //    targetDoc = eval("window.top." + fn_arguments[1] + ".document");
  1765.             //}
  1766.             strTarget = "TARGET='" + fn_arguments[1] + "'";
  1767.         }
  1768.         if (isNaN(fn_arguments[2]) ||  (gbPopupMenuTopicList == null)) {
  1769.             targetDoc.location.href = fn_arguments[3];
  1770.         } else {
  1771.             targetDoc.location.href = gbPopupMenuTopicList[fn_arguments[2]].strURL;
  1772.         }
  1773.         return false;
  1774.     }
  1775.     
  1776.     var strMenu = "";
  1777.     if (gbNav4) {
  1778.         strMenu = '<TABLE BORDER="1" CELLSPACING=0 CELLPADDING=3 BGCOLOR="#c0c0c0">';
  1779.     } else {
  1780.         strMenu = '<TABLE STYLE="border:2px outset white;" CELLSPACING=0';
  1781.         if (gbMac) {
  1782.             strMenu += ' CELLPADDING=4';
  1783.         } else {
  1784.             strMenu += ' CELLPADDING=2';
  1785.         }    
  1786.         strMenu += ' BGCOLOR=#c0c0c0>';
  1787.     }
  1788.  
  1789.     // Add each of the items
  1790.     var i = 2;
  1791.     while (i <= argLen - 1) {
  1792.         strMenu += '<TR><TD><NOBR>'
  1793.         // If the destination is a number then look it up in the topic list
  1794.         if (isNaN(fn_arguments[i]) ||  (gbPopupMenuTopicList == null)) {
  1795.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + fn_arguments[i + 1] + '"' + strTarget;
  1796.         } else {
  1797.             strMenu += '<DIV STYLE="padding-left:3pt; padding-right:3pt;"><A HREF="' + gbPopupMenuTopicList[fn_arguments[i]].strURL + '"' + strTarget;
  1798.         }
  1799.         strMenu += ' onclick="PopupMenu_HandleClick(event);"';
  1800.         strMenu += ' onmouseover="PopupMenu_Over(event);"';
  1801.         strMenu += ' onmouseout="PopupMenu_Out(event);"';
  1802.         strMenu += '>';
  1803.         if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
  1804.             strMenu += '<SPAN CLASS="PopupNotOver">' + fn_arguments[i] + '</SPAN>';
  1805.         } else {
  1806.             strMenu += '<SPAN CLASS="PopupNotOver">' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + '</SPAN>';
  1807.         }
  1808.         strMenu += '</A></DIV></NOBR></TD></TR>';
  1809.  
  1810.         if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) {
  1811.             i += 2;
  1812.         } else {
  1813.             i += 1;
  1814.         }
  1815.     }
  1816.     strMenu += "</TABLE>";
  1817.  
  1818.     if (gbMac) {
  1819.     // totally hack. because ie5 in mac need something. </TABLE> is one of them. mac is mad.
  1820.         strMenu +="<TABLE></TABLE>";
  1821.     }
  1822.  
  1823.     var layerPopup = null;
  1824.     var stylePopup = null;
  1825.     var nEventX = 0;
  1826.     var nEventY = 0;
  1827.     var nWindowWidth = 0;
  1828.     if (gbIE4) {
  1829.  
  1830.         layerPopup = document.all["PopupMenu"];
  1831.         layerPopup.innerHTML = strMenu;
  1832.         stylePopup = layerPopup.style;
  1833.  
  1834.         _BSPSGetClientSize();
  1835.  
  1836.         // Get the position of the item causing the event (relative to its parent)
  1837.         //if (gbMac) {
  1838.         if (true) {
  1839.             nEventX = window.event.clientX;
  1840.             nEventY = window.event.clientY;
  1841.         } else {
  1842.             //??? YJ: Can not remember why we calculate envent position by following code...
  1843.             //but it is wrong in a case like: CENTER->P->TABLE:
  1844.             //the offset positions of TABLE, P and CENTER are same (same offsetTop,offsetLeft)
  1845.             //so we get triple times of offset of x and y as we expect... 
  1846.  
  1847.             nEventX = window.event.srcElement.offsetLeft - document.body.scrollLeft;
  1848.             nEventY = window.event.srcElement.offsetTop - document.body.scrollTop;
  1849.  
  1850.             // Get the location of the parent
  1851.             var nParentLocX = 0;
  1852.             var nParentLocY = 0;
  1853.  
  1854.             var ParentItem = window.event.srcElement.offsetParent;
  1855.             while (ParentItem != null) {
  1856.                 if (ParentItem.offsetLeft)    {
  1857.                     nParentLocX += ParentItem.offsetLeft;
  1858.                     nParentLocY += ParentItem.offsetTop;
  1859.                 }
  1860.                 ParentItem = ParentItem.parentElement;
  1861.             }
  1862.  
  1863.             // Adjust the location of the item using the location of the parent(s)
  1864.             nEventX += nParentLocX;
  1865.             nEventY += nParentLocY;
  1866.         }
  1867.  
  1868.         if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) {
  1869.             nEventY += document.body.scrollTop + 10;
  1870.         } else {
  1871.             nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20;
  1872.         }
  1873.         stylePopup.top = nEventY;
  1874.  
  1875.         if (nEventX + layerPopup.scrollWidth + 20 > gBsClientWidth) {
  1876.             if (gBsClientWidth - layerPopup.scrollWidth < 5) {
  1877.                 stylePopup.left = 5;
  1878.             } else {
  1879.                 stylePopup.left = gBsClientWidth - layerPopup.scrollWidth - 5;
  1880.             }
  1881.         } else {
  1882.             stylePopup.left = nEventX + document.body.scrollLeft + 20;
  1883.         }
  1884.  
  1885.         stylePopup.visibility = "visible";
  1886.         document.onclick = PopupMenu_HandleClick;
  1887.     } else if (gbNav4) {
  1888.         layerPopup = document.layers.PopupMenu;
  1889.         layerPopup.visibility = "hide";
  1890.         stylePopup = layerPopup.document;
  1891.         stylePopup.write(strMenu);
  1892.         stylePopup.close();
  1893.         var e = fn_arguments[0];
  1894.         nEventX = e.pageX;
  1895.         nEventY = e.pageY;
  1896.         _BSPSGetClientSize();
  1897.         if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) {
  1898.             nEventY += 20;
  1899.         } else {
  1900.             nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20;
  1901.         }
  1902.         layerPopup.top = nEventY;
  1903.  
  1904.         if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) {
  1905.             if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) {
  1906.                 nEventX = 5;
  1907.             } else {
  1908.                 nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20;
  1909.             }
  1910.         } else {
  1911.             nEventX += 20;
  1912.         }
  1913.  
  1914.         layerPopup.left = nEventX;
  1915.  
  1916.         layerPopup.visibility = "show";
  1917.  
  1918. //        window.captureEvents(Event.CLICK | Event.MOUSEDOWN);
  1919.         window.captureEvents(Event.MOUSEDOWN);
  1920. //        window.onclick = PopupMenu_HandleClick;
  1921.         window.onmousedown = PopupMenu_HandleClick;
  1922.     }
  1923.  
  1924.     window.gbInPopupMenu = true;
  1925.     window.gbPopupMenuTimeoutExpired = false;
  1926.     setTimeout("PopupMenu_Timeout();", 100);
  1927.     return false;
  1928. }
  1929.  
  1930.  
  1931. function PopupMenu_Timeout()
  1932. {
  1933.     window.gbPopupMenuTimeoutExpired = true;
  1934. }
  1935.  
  1936. function PopupMenu_Over(e)
  1937. {
  1938.     if (gbIE4) {
  1939.         e.srcElement.className = "PopupOver";
  1940.     } else if (gbNav4) {
  1941. //        this.bgColor = "red";
  1942. //        e.target.document.className = "PopupOver";
  1943.     }
  1944.     return;
  1945. }
  1946.  
  1947. function PopupMenu_Out(e)
  1948. {
  1949.     if (gbIE4) {
  1950.         e.srcElement.className = "PopupNotOver";
  1951.     } else if (gbNav4) {
  1952.         this.bgColor = "#f0f0f0";
  1953.     }
  1954.     return;
  1955. }
  1956.  
  1957.  
  1958. function PopupMenu_HandleClick(e)
  1959. {
  1960.     if (!window.gbPopupMenuTimeoutExpired) {
  1961.         return;
  1962.     }
  1963.  
  1964.     window.gbInPopupMenu = false;
  1965.  
  1966.     if (gbNav4) {
  1967. //        window.releaseEvents(Event.CLICK);
  1968.         window.releaseEvents(Event.MOUSEDOWN);
  1969.     }
  1970.  
  1971.     var layerPopup = null;
  1972.     var stylePopup = null;
  1973.     if (gbIE4) {
  1974.         layerPopup = document.all["PopupMenu"];
  1975.         stylePopup = layerPopup.style;
  1976.         stylePopup.visibility = "hidden";
  1977.     } else if (gbNav4) {
  1978.         layerPopup = document.layers.PopupMenu;
  1979.         layerPopup.visibility = "hide";
  1980.     }
  1981.  
  1982.     return;
  1983. }
  1984.  
  1985. // This function should be deleted when all old projects are cleaned up
  1986. function BSPSWritePopupFrameForIE4()
  1987. {
  1988.     return false;
  1989. }
  1990.  
  1991. /////////////////////////////////////////////////////////////////////
  1992. function BSSCPopup_ClickMac()
  1993. {
  1994.     if ((!DHTMLPopupSupport()) && (gbIE4))
  1995.     {    
  1996.         var bClickOnAnchor = false;
  1997.         var el;
  1998.         if ((window.event != null) &&
  1999.             (window.event.srcElement != null))
  2000.         {
  2001.             el = window.event.srcElement;
  2002.             while (el != null)
  2003.             {
  2004.                 if ((el.tagName == "A") || (el.tagName == "AREA"))     {
  2005.                     bClickOnAnchor = true;
  2006.                     break;
  2007.                 }
  2008.                 if (el.tagName == "BODY") {
  2009.                     break;
  2010.                 }
  2011.                 el = el.parentElement;
  2012.             }
  2013.         }
  2014.         if (BSSCPopup_IsPopup())
  2015.         {
  2016.             if (!bClickOnAnchor) {
  2017.                 parent.window.gPopupWindow = null;
  2018.                 self.close();
  2019.             }
  2020.         }
  2021.         else
  2022.         {
  2023.             bClosePopupWindow = true;
  2024.             if ((bClickOnAnchor) &&
  2025.                 (el.href) &&
  2026.                 (el.href.indexOf("javascript:BSSCPopup") != -1))
  2027.             {
  2028.                 bClosePopupWindow = false;
  2029.             }
  2030.             if (bClosePopupWindow)
  2031.             {
  2032.                 if (window.gPopupWindow != null)
  2033.                 {
  2034.                     var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400";
  2035.                     window.gPopupWindow = window.open("", gstrPopupSecondWindowName,strParam);
  2036.                     window.gPopupWindow.close();
  2037.                     window.gPopupWindow = null;
  2038.                 }
  2039.             }
  2040.         }
  2041.     }
  2042.  }
  2043.  
  2044. //////////////////////////////////////////////////////////////////////
  2045.  
  2046. _BSPSGetBrowserInfo();
  2047.  
  2048. function _BSSCOnLoad()
  2049. {
  2050.     if (!gbIE4 && !gbNav4)
  2051.         return;
  2052.  
  2053.     // Make everything visible in navigator
  2054.     if (gbNav4) {
  2055.         // Make some special effects items visible
  2056.         for (var iLayer = 0; iLayer < document.layers.length; iLayer++) {
  2057.             document.layers[iLayer].visibility = gBsStyVisShow;
  2058.             document.layers[iLayer].left = 0;
  2059.         }
  2060.     }
  2061.  
  2062.     // Remove the NavBar if necessary
  2063.     RemoveNavBar();
  2064.         
  2065.     // Don't continue without IE4
  2066.     if (gbIE4) {
  2067.         HHActivateComponents();
  2068.         doStaticEffects();
  2069.         startAnimationSet(0);
  2070.     }
  2071. }
  2072.  
  2073. function _BSSCOnUnload()
  2074. {
  2075. }
  2076.  
  2077. function _BSSCOnClick()
  2078. {
  2079.     if (!gbIE4)
  2080.         return;
  2081.  
  2082.     BSSCPopup_ClickMac();
  2083.     startNextAnimationSet();
  2084. }
  2085.  
  2086. function _BSSCOnError(message)
  2087. {
  2088.     if(-1 != message.indexOf("denied") 
  2089.         || -1 != message.indexOf("Object required"))
  2090.      return true;
  2091. }
  2092.  
  2093.  
  2094. function ResizeBasedonRate(thisWindow, size, rate, maxx, maxy)
  2095. {
  2096.     x = maxx;
  2097.     y = maxy;
  2098.     deltax = -maxx/2;
  2099.     while (true) {
  2100.         x = x + deltax;
  2101.         thisWindow.resizeTo(x, y);
  2102.         thisWindow.resizeTo(x, y);
  2103.         diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * rate;
  2104.         if (diffy >  gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter
  2105.             deltax = Math.abs(deltax) /2;
  2106.         else if (diffy <  -permitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter
  2107.             deltax = -Math.abs(deltax) /2;
  2108.         else 
  2109.             // the y is close enough to wanted.
  2110.             break;
  2111.         if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore.
  2112.             break;
  2113.         //j ++;
  2114.                 
  2115.     }
  2116.     size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth;
  2117.     size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight;    
  2118.     thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little.
  2119. }
  2120.  
  2121. //////////BSSCDHTML Section Embedded Code//////////
  2122. var s_strAgent = navigator.userAgent.toLowerCase();
  2123. var s_nVer       = parseInt(navigator.appVersion);
  2124.  
  2125. var s_bIE  = (s_strAgent.indexOf('msie') != -1);
  2126. var s_bNS  = (s_strAgent.indexOf('mozilla') != -1) && ((s_strAgent.indexOf('spoofer') == -1) && (s_strAgent.indexOf('compatible') == -1));
  2127. var s_bOpera    = (s_strAgent.indexOf('opera') != -1);
  2128.  
  2129. var s_bIE3Before = ((s_bIE) && (s_nVer <= 2));
  2130. var s_bNS3Before = ((s_bNS) && (s_nVer <= 3));
  2131.  
  2132. var s_bNS2        = ((s_bNS) && (s_nVer <= 2));
  2133. var s_bNS3        = ((s_bNS) && (s_nVer == 3));
  2134. var s_bIE300301    = ((s_bIE) && (s_nVer == 2) && ((s_strAgent.indexOf("3.00") != -1)||(s_strAgent.indexOf("3.0a") != -1)||(s_strAgent.indexOf("3.0b")!=-1)||(s_strAgent.indexOf("3.01")!=-1)));
  2135. var s_bIE302    = ((s_bIE) && (s_nVer == 2) && (s_strAgent.indexOf("3.02") != -1));
  2136.  
  2137.  
  2138. function HasExtJs()
  2139. {
  2140.     if (s_bIE3Before) { return false;}
  2141.     if (s_bNS3Before) {    return false;}
  2142.     if (typeof (_BSSCOnLoad) == "undefined"){ return false; }
  2143.     return true;
  2144. }
  2145.  
  2146. function BSSCOnLoad()
  2147. {
  2148.     if (HasExtJs()) { _BSSCOnLoad(); }
  2149. }
  2150.  
  2151. function BSSCOnUnload()
  2152. {
  2153.     if (HasExtJs()) { _BSSCOnUnload(); }
  2154. }
  2155.  
  2156. function BSSCOnClick()
  2157. {
  2158.     if (HasExtJs()) { _BSSCOnClick(); }
  2159. }
  2160.  
  2161. function BSSCOnError(message)
  2162. {
  2163.     if (HasExtJs()) { return _BSSCOnError(message); }
  2164. }
  2165.  
  2166.  
  2167. function WritePopupMenuLayer()
  2168. {
  2169.     if (HasExtJs()) {_WritePopupMenuLayer();}
  2170. }
  2171.  
  2172. function BSSCCreatePopupDiv()
  2173. {
  2174.     if (HasExtJs()) {_BSSCCreatePopupDiv();    }
  2175. }
  2176.  
  2177. function BSSCPopup(strURL)
  2178. {
  2179.     if (HasExtJs())    { 
  2180.         _BSSCPopup(strURL);
  2181.     }else{
  2182.         //Create a temporary window first to ensure the real popup comes up on top
  2183.         var wndTemp = null;
  2184.         if (!s_bNS3) {
  2185.             wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  2186.         }
  2187.         // Create the real popup window
  2188.         var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400");
  2189.         // Close the temporary
  2190.         if (!s_bNS3) {
  2191.             wndTemp.close();
  2192.         } else {
  2193.             wndPopup.focus();
  2194.         }
  2195.     }
  2196. }
  2197.  
  2198. var gbWndTemp = null, gbWndPopupLinks = null;
  2199. var gbstrParaTotal = "";
  2200.  
  2201. function PopupMenu_Invoke()
  2202. {
  2203.     if (HasExtJs()) {
  2204.         return _PopupMenu_Invoke(PopupMenu_Invoke.arguments);
  2205.     }
  2206.     if (s_bNS3Before || s_bIE3Before )    {
  2207.         var argLen     = PopupMenu_Invoke.arguments.length;
  2208.         if (argLen < 5) {
  2209.             window.document.location.href = PopupMenu_Invoke.arguments[3];
  2210.             return false;
  2211.         }
  2212.         gbWndTemp = null;
  2213.         gbWndPopupLinks = null;
  2214.         gbstrParatotal = "";
  2215.         for (var i = 0; i < (argLen - 2) / 2; i++) {
  2216.             var strParaLine = "";
  2217.             if (s_bNS2 || s_bOpera){
  2218.                 strParaLine += "<a href=\"";
  2219.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  2220.                 strParaLine += "\">"
  2221.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  2222.                 strParaLine += "</a>";
  2223.             } else {
  2224.                 strParaLine += "<a href=\"javascript:";
  2225.                 strParaLine += "gotoUrl(\'";
  2226.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 3];
  2227.                 strParaLine += "\');\"";
  2228.                 if (PopupMenu_Invoke.arguments[1] != '') {
  2229.                     strParaLine += " TARGET='" + PopupMenu_Invoke.arguments[1] + "'";
  2230.                 }
  2231.                 strParaLine += ">";
  2232.                 strParaLine += PopupMenu_Invoke.arguments[2 * i + 2];
  2233.                 strParaLine += "</a>";
  2234.             }
  2235.             strParaLine += "<br>";
  2236.             gbstrParaTotal += strParaLine;
  2237.         }
  2238.         var nHeight = argLen * 15;
  2239.         var nWidth = 400;
  2240.         var strParam = "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=auto";
  2241.         strParam += ",height=" + nHeight + ",width=200,resizable";
  2242.         
  2243.         //Create a temporary window first to ensure the real popup comes up on top
  2244.         //var wndTemp = null;
  2245.         if (!s_bNS3) {
  2246.             gbWndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4");
  2247.         } 
  2248.         gbWndPopupLinks = window.open("", "popuplinks", strParam);
  2249.  
  2250.         setTimeout("Wait_PopupMenuReady()", 100);
  2251.     }
  2252.     return true;
  2253. }
  2254.  
  2255. function Wait_PopupMenuReady() 
  2256. {
  2257.     if (gbWndPopupLinks != null && "object" == typeof(gbWndPopupLinks.document)) {
  2258.         PopupMenu_InvokeReady();
  2259.     }
  2260.     else 
  2261.         setTimeout("Wait_PopupMenuReady()", 100);
  2262. }
  2263.  
  2264.  
  2265. function PopupMenu_InvokeReady()
  2266. {
  2267.     if (gbWndPopupLinks != null) {
  2268.         gbWndPopupLinks.document.open("text/html");
  2269.         gbWndPopupLinks.document.write("<html><head>");
  2270.         if (s_bNS2 || s_bOpera) {
  2271.             gbWndPopupLinks.document.write("<base href=\"" + location +"\">");
  2272.         } else {
  2273.             //YJ: IE301,302 and NS3.x works fine
  2274.             gbWndPopupLinks.document.write("<");
  2275.             gbWndPopupLinks.document.write("script>");
  2276.             gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}");
  2277.             gbWndPopupLinks.document.write("<");
  2278.             gbWndPopupLinks.document.write("/script>");
  2279.         }
  2280.         gbWndPopupLinks.document.write("</head><body onBlur=\'self.focus();\'>");
  2281.         gbWndPopupLinks.document.write(gbstrParaTotal);
  2282.         gbWndPopupLinks.document.write("</body></html>");
  2283.         gbWndPopupLinks.document.close();
  2284.  
  2285.         // Close the temporary
  2286.         if (!s_bNS3 && gbWndTemp != null) {
  2287.             gbWndTemp.close();
  2288.         }else {
  2289.             gbWndPopupLinks.focus();
  2290.         }
  2291.  
  2292.         return true;
  2293.     }
  2294.     return false;
  2295. }
  2296.  
  2297.   
  2298. onload = BSSCOnLoad;
  2299. document.onclick = BSSCOnClick;
  2300. onunload = BSSCOnUnload;
  2301. onerror = BSSCOnError;